
package com.hb.software.department.impl;

import com.hb.software.department.DepartmentService;
import com.hb.software.department.dao.DepartmentDao;
import com.hb.software.entity.department.Department;
import com.hb.software.service.impl.BaseServiceImpl;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public  class DepartmentServiceImpl extends BaseServiceImpl<Department,Long> implements DepartmentService {


    private static final Logger logger = LogManager.getLogger(DepartmentServiceImpl.class.getName());

    private DepartmentDao departmentDao;

    @Autowired
    public void setDepartmentDAO(DepartmentDao departmentDao) {
        this.departmentDao = departmentDao;
        this.dao = this.departmentDao;
    }



    @Override
    public List findByName(String name){
        List list = departmentDao.findByName(name);
        return list;
    }


    @Override
    public long findLastId() {
        return departmentDao.findLastId();
    }
}

